<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="ssm" uri="http://ssm.elangzhi.com/jsp/tag/functions" %>
<%--
Created by GaoXiang
Date: 2019-08-07 15:59:45 星期三
Version: 1.0
停车场编辑页面
--%>

<div class="portlet light" >
    <div class="portlet-body form">
        <!-- BEGIN FORM-->
        <form action="#" class="form-horizontal" id="edit-module">
            <div class="form-body">

                <div class="row">
                    <div class="col-md-6 hide">
                        <div class="form-group">
                            <label class="control-label col-md-3">ID</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="id" value="${data.id}" placeholder="默认生成，ID">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">name</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="name" value="${data.name}" placeholder="name">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">lon</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="lon" value="${data.lon}" placeholder="lon">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">lat</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="lat" value="${data.lat}" placeholder="lat">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">berthNum</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="berthNum" value="${data.berthNum}" placeholder="berthNum">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">berthSurplus</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="berthSurplus" value="${data.berthSurplus}" placeholder="berthSurplus">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">startBusiness</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="startBusiness" value="${data.startBusiness}" placeholder="startBusiness">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">endBusiness</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="endBusiness" value="${data.endBusiness}" placeholder="endBusiness">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">cityName</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="cityName" value="${data.cityName}" placeholder="cityName">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">cityId</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="cityId" value="${data.cityId}" placeholder="cityId">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">createTime</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="createTime" value="${data.createTime}" placeholder="createTime">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">timeLimitStatus</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="timeLimitStatus" value="${data.timeLimitStatus}" placeholder="timeLimitStatus">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">type</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="type" value="${data.type}" placeholder="type">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">reStatus</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="reStatus" value="${data.reStatus}" placeholder="reStatus">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">eqStatus</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="eqStatus" value="${data.eqStatus}" placeholder="eqStatus">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">parkCode</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="parkCode" value="${data.parkCode}" placeholder="parkCode">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">addressInfo</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="addressInfo" value="${data.addressInfo}" placeholder="addressInfo">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">parkInfo</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" required name="parkInfo" value="${data.parkInfo}" placeholder="parkInfo">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-actions">
                <div class="row">
                    <div class="col-md-6">
                        <div class="row">
                            <div class="col-md-offset-3 col-md-9">
                                <button type="button" class="btn green" onclick="edit();">修改停车场</button>
                                <button type="button" class="btn default" onclick="layer.close(layer_editModule);">取消</button>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6"> </div>
                </div>
            </div>
        </form>
        <!-- END FORM-->
    </div>
</div>
<!-- script 开始 -->
<script>

    $(function(){
        //初始化页面
        initPage();
    });

    /**
     * 保存编辑的停车场
     */
    function edit(){
        var param = tools.formParams("edit-module");
        if(tools.valid("edit-module")){
            tools.post("/park/update",param,function(data){
                if(data.success){
                    layer.msg('停车场修改成功', {icon: 1,time:1000},function(){
                        //刷新列表页面
                        toPage(null);
                        //关闭弹窗
                        layer.close(layer_editModule);
                    });
                }else{
                    tools.errorTip(data.code,data.data);
                }
            });
        }
    }
</script>
<!-- script 结束 -->